<template>
  <div>
    <van-nav-bar title="进度查询" left-arrow @click-left="$router.back()"/>
    <div class="home-list-box">
      <ab-scroller url="/plugin/mobileBusiCenter/queryProgress">
        <div slot-scope="slotScope">
      <div class="product_main">
        <gz-default-page v-if="!slotScope.rows || slotScope.rows.length <= 0" :imageSize="'14.8rem'" :textSize="'1.4rem'" :text="'暂无记录'"></gz-default-page>
        <div v-for="(apply,index) in slotScope.rows" :key="apply.id">
          <router-link :to="{path:'/loanPage/applyStatus',query:{progress: apply.progressStatus}}">
            <div class="loan-list-style">
              <div class="content-box">
                <div class="card-item">
                  <div class="item-title">申请编号</div>
                  <div class="item-value">{{ apply.instId }}</div>
                </div>
                <div class="card-item">
                  <div class="item-title">申请金额</div>
                  <div class="item-value">{{ abTools.comdify(Number(apply.aplyAmt).toFixed(2)) }}</div>
                </div>
                <div class="card-item">
                  <div class="item-title">贷款产品</div>
                  <div class="item-value">{{ apply.prodNam }}</div>
                </div>
                <div class="card-item">
                  <div class="item-title">申请日期</div>
                  <div class="item-value">{{ apply.aplyDt }}</div>
                </div>
                <template v-if="apply.progressStatus == '01' || apply.progressStatus == '02'">
                  <div class="card-item">
                    <div class="item-title">授信额度</div>
                    <div class="item-value">{{ abTools.comdify(Number(apply.contractAmt).toFixed(2)) }}</div>
                  </div>
                  <div class="card-item">
                    <div class="item-title">借款期限</div>
                    <div class="item-value">{{ apply.bsnReplyDdl }} 期</div>
                  </div>
                </template>
                <img v-if="apply.progressStatus == '00'" class="repayment-completed" :src="require(`@/assets/public/accepting.png`)" alt=""/>
                <img v-if="apply.progressStatus == '01'" class="repayment-completed" :src="require(`@/assets/public/to-be-signed.png`)" alt=""/>
                <img v-if="apply.progressStatus == '02'" class="repayment-completed" :src="require(`@/assets/public/completed.png`)" alt=""/>
                <img v-if="apply.progressStatus == '03'" class="repayment-completed" :src="require(`@/assets/public/refused.png`)" alt=""/>
              </div>
            </div>
          </router-link>
        </div>
      </div>
       </div>
    </ab-scroller>
    </div>
  </div>
</template>

<script>

import Vue from 'vue';
import {gzDefaultPage} from '@/components/customize'

export default {
  components: {gzDefaultPage},
  data: function () {
    return {
      InstanceStatus: null,
      dataList: [],
      active: '',
    }
  },
  created: function () {
  },
  methods: {
    
  }
}
</script>
<style scoped lang="less">
/deep/ ._v-container {
  top: 4.2rem !important;
  height: calc(~'100vh - 4.5rem') !important;
}

/deep/ .van-nav-bar {
  .van-nav-bar__content {
    height: 4.4rem;
    line-height: 2rem;

    .van-icon {
      color: rgb(50, 50, 51);
      font-size: 2rem;
    }

    .van-nav-bar__title {
      font-size: 1.8rem;
    }
  }
}

[class*=van-hairline]::after {
  border: 0;
}

/*列表样式start*/
.product_main {
  // overflow-y: auto;
  // height: calc(~'100vh - 4.4rem');

  .apply-title {
    padding: 1.6rem 2.4rem 0;
    font-size: 1.6rem;
    line-height: 1.9rem;
    font-weight: 500;
    color: rgb(29, 33, 41);

    span {
      margin-left: 0.8rem;
      font-size: 1.4rem;
      line-height: 1.6rem;
      font-weight: 400;
      color: rgba(29, 33, 41, 0.54);
    }
  }
}

.loan-list-style {
  background-color: #FFF;
  border-radius: 1.2rem;
  padding: 0 1.2rem;
  box-sizing: border-box;
  margin: 1.2rem;
  overflow: hidden;

  .title-box {
    padding: 1.2rem 0 0.8rem;
    border-bottom: 0.6px solid #f2f2f2;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .loan-code {
    font-size: 1.2rem;
    line-height: 1.4rem;
    color: rgba(29, 33, 41, 0.54);
    margin-top: 0.8rem;
  }

  .loan-title {
    font-size: 1.6rem;
    line-height: 1.9rem;
    color: rgb(29, 33, 41);
    font-weight: 700;
  }

  .btn-group {
    display: flex;
    flex-direction: row-reverse;

    .btn {
      padding: 0.6rem 1.8rem;
      font-size: 1.4rem;
      color: rgb(255, 255, 255);
      font-weight: 500;
      text-align: center;
      background: linear-gradient(90.00deg, var(--gradient2-color), var(--primary-color));
      border-radius: 4rem;
      line-height: 1.4rem;
      margin-top: 1rem;
    }
  }

  .content-box {
    padding: 0.8rem 0;
    font-size: 1.4rem;
    font-weight: 400;
    position: relative;

    .repayment-completed{
      width: 7rem;
      position: absolute;
      bottom: -0.6rem;
      right: -1.8rem;
    }

    .card-item {
      display: flex;
      align-items: center;
      // margin-top: 0.8rem;
      min-height: 2.8rem;

      .item-title {
        color: rgba(29, 33, 41, 0.54);
        margin-right: 1.6rem;
        min-width: 9rem;
      }

      .item-value {
        color: rgb(29, 33, 41);

        .price {
          span {
            // font-size: 1.8rem;
            font-weight: 500;
          }

          &.active {
            color: var(--primary-color);
          }
        }

        .red {
          color: rgb(245, 63, 63);
        }

        .green {
          color: rgb(0, 180, 42);
        }

        .orange {
          color: rgb(255, 125, 0);
        }
      }
    }
  }
}

/*列表样式end*/
</style>
